@extends('admin.app')

@section('breadcrumb')
    <div class="bg-light lter b-b wrapper-md">
        <ol class="breadcrumb bg-light lter m-n no-padder">
            <li><a href="{{ admin_action('HomeController@index') }}">主页</a></li>
            <li>业务管理</li>
            <li><a href="{{ admin_action('Business\UsersController@index') }}">用户管理</a></li>
            <li class="active">新增用户</li>
        </ol>
    </div>
@endsection

@section('content')
    <div class="panel panel-default">
        <div class="panel-heading font-bold">
            用户信息表单
        </div>
        <div class="panel-body">
            <form enctype="multipart/form-data" class="form-horizontal form-validation"
                  action="{{ admin_action('Business\UsersController@saveRealName',[$id]) }}"
                  method="post">
                {{ csrf_field() }}
                <label>实名认证信息</label>
                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">真实姓名*</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="name"
                               value="{{ old('name') }}" placeholder="请填写用户真实姓名" data-rule-required="true"
                               data-msg-required="必须填写用户姓名"
                               data-rule-pattern="[\u4E00-\u9FA5]{2,5}(?:·[\u4E00-\u9FA5]{2,5})*"
                               data-msg-pattern="用户姓名不合法">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-2 control-label">身份证号码*</label>
                    <div class="col-lg-4">
                        <input type="text" class="form-control" name="id_card"
                               value="{{ old('id_card') }}" placeholder="请填写用户身份证号码"
                               data-rule-id_card="true" data-rule-required="true" data-msg-required="必须填写用户身份证信息">
                    </div>
                </div>

                <div class="line line-dashed b-b line-lg"></div>
                <div class="form-group">
                    <div class="col-lg-4 col-lg-offset-2">
                        <a href="javascript:history.back()"
                           class="btn btn-default">返&nbsp;回</a>
                        <button type="submit" class="btn btn-primary">认证实名信息</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
@endsection
@section('scripts')
    @include('admin.partials.ueditor')
    <script>
        $('#ck_failure').click(function () {
            if ($(this)[0].checked) {
                //禁用身份证过期时间选择
                $('input[name="failure_time"]')[0].disabled = true;
            } else {
                //启用身份证过期时间选择
                $('input[name="failure_time"]')[0].disabled = false;
            }
        });
    </script>
@endsection